Tests for the LR-, LL-, and LC-Regular Conditions

نویسنده

  • Stephan Heilbrunner
چکیده

Most of the linear time parsing strategies (e.g., LL(k) and U(k) type parsers) for context-free grammars operate by looking ahead on the input tape for a fixed number of symbols. The fixed length look-ahead strings partition the set of input strings into classes of strings which are equivalent with respect to parsing decisions. A moment’s thought shows that these look-ahead classes are regular sets. This observation lends itself to a generalization introduced by Culik and Cohen [2]. The idea is to allow arbitr&y sets as look-ahead classes as long as they form a finite partition of the set of input strings. Culik and Cohen applied this idea to LR parsing and obtained the class of LR-regular grammars. Later, the idea was applied to strong LL parsing [7] and to LL parsing [8]. In all cases tests and parsing algorithms for these grammar classes together with various other properties were obtained. This paper had its origin in an example grammar where the criterion of Culik and Cohen fails. This example raises two questions. What is the class of grammars characterized by Culik and Cohen’s criterion? How can we test for the LR-regular condition? Both questions will be answered in the sequel. The first problem will be solved by a simple trick. The answer to the second question will be obtained by generalizing the item method which is well known from M(k) theory. We shall make use of ideas of [4] and shall obtain tests and various other properties for the classes of LL-regular and LC-regular grammars as a by-product. We establish our notation. “Grammar” always means context-free grammar. All grammars are supposed to be reduced, i.e., all nonterminals are reachable and produce terminal strings. The grammar G = (V, 2, P, S) is arbitrary but fixed. We shall make liberal use of the definitions, notations, and facts from [3]. Our conventions for the use of variables are shown in Table I, where ZZ denotes partitions of Z*. These conventions are an essential part of propositions, e.g., L(G) = {xl S %x) 1 0022~0000183 53.00

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

LR(k) Testing is Average Case Complete

In this note, we show that LR(k) testing of context-free grammars with respect to random instances is many-one complete for DistNP (Distributional NP). The same result holds for testing whether a context-free grammar is LL(k), strong LL(k), SLR(k), LC(k) or strong LC(k), respectively.

متن کامل

Performance of Tadpoles from the Hybridogenetic Rana Esculenta Complex: Interactions with Pond Drying and Interspecific Competition.

The performance of three genotypes (LL, LR, RR) of tadpoles resulting from the hybrid mating system of Rana lessonae (phenotype L, genotype LL) and Rana esculenta (phenotype E, genotype LR) was determined in artificial ponds. The effects of interspecific competition and pond drying on growth, development, and survival of tadpoles were used to measure the performance of genotypes and the relativ...

متن کامل

The Equivalence Problem for LL- and LR-Regular Grammars

Questions whether or not two grammars belonging to a family of grammars generate the same language have extensively been studied in the literature. These problems are called equivalence problems and if there exists an algorithm which for each pair of grammars of this family gives an answer to this question then the equivalence problem for this family of grammars is said to be decidable. Otherwi...

متن کامل

On the Complexities of Linear LL(1) and LR(1) Grammars

Several notions of deterministic linear languages are considered and compared with respect to their complexities and to the families of formal languages they generate. We exhibit close relationships between simple linear languages and the deterministic linear languages both according to Nasu and Honda and to Ibarra, Jiang, and Ravikumar. Deterministic linear languages turn out to be special cas...

متن کامل

Unifying LL and LR parsing

In parsing theory, LL parsing and LR parsing are regarded to be two distinct methods. In this paper the relation between these methods is cla-riied. As shown in literature on parsing theory, for every context-free grammar, a so-called non-deterministic LR(0) automaton can be constructed. Here, we show, that traversing this automaton in a special way is equivalent to LL(1) parsing. This automato...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • J. Comput. Syst. Sci.

دوره 27  شماره 

صفحات  -

تاریخ انتشار 1983